<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <a href="https://www.cnblogs.com/Jacklovely/p/6158539.html">点击</a>
    <script>
        console.log(window.location === document.location);
        console.log('当前页面的片段是：', location.hash);
        console.log('当前页面的端口和域名或ip：', location.host);
        console.log('当前窗口的域名', location.hostname);
        console.log('当前窗口的端口', location.port);
        console.log('当前窗口的查询参数', location.search);
        console.log('当前窗口的协议', location.protocol);
        console.log('当前窗口的路径', location.pathname);
        console.log('当前窗口的url', location.href);
    </script>
</body>
</html>